/**
 * @file new.cpp
 * @author sqqdfny@163.com
 * @brief  This file is used to replace the new/delete functions of C++.
 * @version 0.1
 * @date 2025-09-14
 * 
 * @copyright Copyright (c) 2025
 * 
 */
//==================================================================================================
#include "./new.hpp"
#include "../malloc.h"

#ifndef WITH_SDL
void* operator new(std::size_t size) __THROW_BAD_ALLOC {
    return malloc(size);
    // return malloc_trace(size);
}

void* operator new[](std::size_t size) __THROW_BAD_ALLOC {
    return malloc(size);
    // return malloc_trace(size);
}

void operator delete(void* obj) throw() {
    free(obj);
    // free_trace(obj);
}

void operator delete[](void* obj) throw() {
    free(obj);
    // free_trace(obj);
}
#endif /*WITH_SDL*/
//==================================================================================================

